﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FlashCards.Model;

namespace FlashCards.WebApp.Models
{
    public class GroupMembersModel
    {
        public GroupModel Group { get; set; }
        public List<FriendModel> Members { get; set; }
        public string OwnerNick { get; set; }

        public GroupMembersModel(Group group, List<User> members, string ownerNick)
        {
            Group = new GroupModel(group);
            OwnerNick = ownerNick;

            Members = new List<FriendModel>();
            Members.AddRange(
                members.Select(x => new FriendModel(x)));
        }
    }
}